﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StackU
{
    class Program
    {
        static void Main(string[] args)
        {
            //定义stack堆栈
            Stack t = new Stack();
            //向栈中存放元素→入栈
            t.Push("《说笑》");
            t.Push("《想点大事》");
            t.Push("《成就》");
            t.Push("《盲从与叛逆》");
            t.Peek();
            Console.WriteLine("书架上有这些书籍:");
            foreach (var v in t)
            {
                Console.WriteLine("\t" + v);
            }
            Console.WriteLine();
            Console.WriteLine("取下爱书:");
            //检索
            while(t.Count!=0)
            {
                //调出栈中数据
                Console.WriteLine("\t"+t.Pop());
            }


        }
    }
}
